<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>for-in</title>
    <link href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/3.3.6/css/bootstrap.css" rel="stylesheet">
    <script src="../vue.min.js"></script>
</head>
<body>
    <div class="container" id="mainConnect">
        <div class="panel panel-default">
            <div class="panel panel-default">
                  <div class="panel-heading">
                        <h3 class="panel-title">FOR-IN</h3>
                  </div>
                  <div class="panel-body">
                    <div class="row">
                        <div class="col-xs-4">
                            <div class="form-group">
                                <label for="">for-in 输chu值 : </label>
                                <span v-for= "(item, index) in forData" :key="`for-data-${item.id}`" class="label label-info">
                                    {{item.name}}
                                </span>
                            </div>
                        </div>
                        <div class="col-xs-4">
                            <div class="form-group">
                                <label for="">for-in 输出值</label>
                                <span v-for="(item,i) in forData"  
                                    :key="`for-data-${item.id}`" 
                                    :class="['label', item.cls]">
                                    {{item.name}}
                                </span>
                            </div>
                        </div>
                    </div>
                  </div>
            </div>
        </div>
    </div>
    <script>
        new Vue({
            el:'#mainConnect',
            data() {
                return {
                    forData: [
                        {cls: 'label-warning',name: 'first', id: '1'},
                        {cls: 'label-info',name: 'two', id: '2'},
                        {cls: 'label-danger',name: 'thrid', id: '3'}
                    ]
                }
            }
        })
    </script>
</body>
</html>